/* $Id: MonitorRowEntry.java 67 2010-10-11 10:26:34Z altdotua@gmail.com $ */

package alt.djudge.frontend.server.datatypes;

import java.util.HashMap;
import java.io.Serializable;

import alt.djudge.frontend.server.datatypes.scores.ProblemUserScoreEntry;

public class MonitorRowEntry implements Comparable<MonitorRowEntry>, Serializable
{
	private static final long serialVersionUID = 1L;

	private UserEntry user;
	
	private int score = 0;
	
	private int solved = 0;
	
	private Long time;
	
	private HashMap<Long, SubmissionEntry> details;
	
	private HashMap<Long, ProblemUserScoreEntry> details2;
	
	public MonitorRowEntry(UserEntry user, int score, int solved, HashMap<Long, SubmissionEntry> details)
	{
		this.details = details;
		this.score = score;
		this.solved = solved;
		this.user = user;
	}

	public MonitorRowEntry(UserEntry user, int score, int solved, HashMap<Long, ProblemUserScoreEntry> details, boolean f)
	{
		this.details2 = details;
		this.score = score;
		this.solved = solved;
		this.user = user;
	}


	public void setUser(UserEntry user)
	{
		this.user = user;
	}


	public UserEntry getUser()
	{
		return user;
	}


	public void setScore(int score)
	{
		this.score = score;
	}


	public int getScore()
	{
		return score;
	}


	public void setSolved(int solved)
	{
		this.solved = solved;
	}


	public int getSolved()
	{
		return solved;
	}


	public void setDetails(HashMap<Long, SubmissionEntry> details)
	{
		this.details = details;
	}


	public HashMap<Long, SubmissionEntry> getDetails()
	{
		return details;
	}


	@Override
	public int compareTo(MonitorRowEntry o)
	{
		return o.score - score;
	}

	public void setDetails2(HashMap<Long, ProblemUserScoreEntry> details2)
	{
		this.details2 = details2;
	}

	public HashMap<Long, ProblemUserScoreEntry> getDetails2()
	{
		return details2;
	}

	public void setTime(Long time)
	{
		this.time = time;
	}

	public Long getTime()
	{
		return time;
	}
	
}
